package com.apt.action;

import java.util.List;

import com.apt.common.AptException;
import com.apt.facade.DataStoreHelper;
import com.apt.model.AptTest;

public class ListTestsAction extends AptBaseAction {

	private List<AptTest> tests;
	private String loggedUser;
	

	public String getLoggedUser() {
		return loggedUser;
	}

	public List<AptTest> getTests() {
		return tests;
	}

	public String displayTestDetails() {

		try {
			loggedUser=(String)session.get("loggedFirstName");
			
			tests = DataStoreHelper.getTestDetails();
			return "success";

		} catch (AptException apt) {
			addActionError(apt.getMessage());
			return "error";

		}

	}
}